<?php
class EmptyAction extends BaseAction
{
	public function _initialize()
	{
		parent::_initialize();
	}

	/**
	 * 默认方法
	 * @author Ice <iceinto@mallog.com.cn>
	 */
	public function _empty()
	{
		$pathInfo = $this->getUrlPathInfo();
		if ($pathInfo) {
			$pathSize = count($pathInfo);
			$data = array();
			if ($pathSize == 2) {
				//商场
				$data = $this->checkUrl($pathInfo[1]);
				//调用商场首页
				if ($data['level'] == 1) {
					A('Mobile/Mall')->home($data['mall']);
				}
			} else if ($pathSize == 3) {
				//楼层
				$data = $this->checkUrl($pathInfo[1], $pathInfo[2]);
				if ($data['level'] == 2) {
					A('Mobile/Mall')->floor($data['mall'], $data['floor']);
				}
			} else if ($pathSize == 4) {
				//品牌
				$data = $this->checkUrl($pathInfo[1], $pathInfo[2], $pathInfo[3]);
				if ($data['level'] == 3) {
					A('Mobile/FloorBrand')->home($data['mall'], $data['floor'], $data['brand']);
				}
			} else {
				exit;
			}

		} else {
			exit();
		}
	}

	/**
	 * 获取访问URL
	 * @author Ice <iceinto@mallog.com.cn>
	 */
	public function getUrlPathInfo()
	{
		$pathInfo = strtolower($_SERVER['PATH_INFO']);
		$pathInfo = explode(C('URL_PATHINFO_DEPR'), $pathInfo);
		return $pathInfo;
	}
}

?>